/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file           : main.h
  * @brief          : Header for main.c file.
  *                   This file contains the common defines of the application.
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; Copyright (c) 2024 STMicroelectronics.
  * All rights reserved.</center></h2>
  *
  * This software component is licensed by ST under Ultimate Liberty license
  * SLA0044, the "License"; You may not use this file except in compliance with
  * the License. You may obtain a copy of the License at:
  *                             www.st.com/SLA0044
  *
  ******************************************************************************
  */
/* USER CODE END Header */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32f1xx_hal.h"
#include "string.h"
typedef uint32_t  u32;
typedef uint16_t u16;
typedef uint8_t  u8;
typedef int8_t  s8;
typedef __IO uint32_t  vu32;


#include "stm32f1xx_ll_rcc.h"
#include "stm32f1xx_ll_bus.h"
#include "stm32f1xx_ll_system.h"
#include "stm32f1xx_ll_exti.h"
#include "stm32f1xx_ll_cortex.h"
#include "stm32f1xx_ll_utils.h"
#include "stm32f1xx_ll_pwr.h"
#include "stm32f1xx_ll_dma.h"
#include "stm32f1xx_ll_rtc.h"
#include "stm32f1xx_ll_tim.h"
#include "stm32f1xx_ll_usart.h"
#include "stm32f1xx_ll_gpio.h"
#include "stm32f1xx_ll_iwdg.h"
#include "cmsis_os.h"
#include "stdlib.h"
#include "math.h"
#include "time.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
//#include "stm32f10x.h"                  // Device header
#include "eeprom_APP.h"
#include "global.h"
#include "DEF_config.h"
#include "usart.h"
#include "can.h"
#include "tim.h"
#include "gpio.h"



#include "emb1426.h"
#include "XiazaiCaiYangBan.h"
#include "RTE_Insulation.h"
#include "bsp_alarm.h"
#include "bsp_rtc.h"
#include "RTE_ArgConfig.h"
/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */

/* USER CODE END ET */

/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */

/* USER CODE END EC */

/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */

/* USER CODE END EM */

/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);

/* USER CODE BEGIN EFP */

/* USER CODE END EFP */

/* Private defines -----------------------------------------------------------*/
//#define EMB_ADOUT_Pin LL_GPIO_PIN_1
//#define EMB_ADOUT_GPIO_Port GPIOC
//#define EMB_ADCS_Pin LL_GPIO_PIN_2
//#define EMB_ADCS_GPIO_Port GPIOC
//#define EMB_CLK_Pin LL_GPIO_PIN_3
//#define EMB_CLK_GPIO_Port GPIOC
//#define EMB_PWM_Pin LL_GPIO_PIN_1
//#define EMB_PWM_GPIO_Port GPIOA

#define LIFE_LED_Pin LL_GPIO_PIN_0
#define LIFE_LED_GPIO_Port GPIOB
#define UART1_DE_Pin LL_GPIO_PIN_9
#define UART1_DE_GPIO_Port GPIOC
/* USER CODE BEGIN Private defines */
#define RS485_RxEn()  LL_GPIO_ResetOutputPin(UART1_DE_GPIO_Port,UART1_DE_Pin)
#define RS485_RxDen() LL_GPIO_SetOutputPin(UART1_DE_GPIO_Port,UART1_DE_Pin)


#define LED_Ctrl_H		LL_GPIO_SetOutputPin(LIFE_LED_GPIO_Port,LIFE_LED_Pin)
#define LED_Ctrl_L		LL_GPIO_ResetOutputPin(LIFE_LED_GPIO_Port,LIFE_LED_Pin)


#define PowerCom_Pin            LL_GPIO_PIN_8
#define PowerCom_Port           GPIOC
#define	OpenPower()			    LL_GPIO_ResetOutputPin(PowerCom_Port,PowerCom_Pin) 
/* USER CODE END Private defines */

extern const uint8_t BOARD_FLASH_VALUE[];
extern const uint8_t BOARD_SAMP_VALUE[];
#ifdef __cplusplus
}
#endif

#endif /* __MAIN_H */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
